home *** CD-ROM | disk | FTP | other *** search
/ Professional Soft Collection 1.02 / Professional Soft Collection 1.02.iso / communic / bitfax.300 / disk1 / dataans.sc_ / dataans.bin
Encoding:
Text File  |  1994-04-19  |  4.8 KB  |  182 lines

  1. :done
  2.     @d = fopeni("welcome.txt", "t")  {open welcome message file }
  3.     if ( @d = -1 ) goto :command     {no welcome file found     }
  4.     "$0d$0a"
  5.     {send welcome file to caller}
  6.  
  7. :loop2
  8.     @a=fgets("welcome.txt")
  9.     if ( @a <> -1 ) "@a$0d$0a"       {if is equal -1 means EOF met}
  10.     if ( @a <> -1 ) goto :loop2
  11.     fclosei("welcome.txt")
  12.  
  13. :quit
  14.     typecr("LOGON OK");
  15. { Main command loop. Lets caller enter all DOS commands except FORMAT }
  16. { and RENAME }
  17. :command
  18.     twait(2,"sec");
  19.     "$0d$0a"
  20.     "Type ""FILE"" for file transfer, ""DIR <path>"" for file list, ""BYE"" to quit:$0d$0a"
  21.     @a=getline
  22.     @a=toupper(@a)
  23.     if ( @a = "") goto :command
  24.     if ( substr(@a, 1, 3) = "BYE" ) goto :leave
  25.     if ( substr(@a, 1, 4) = "FILE" ) goto :filetrans
  26.     if ( substr(@a, 1, 3) = "DIR" ) goto :dirfile
  27.     goto :command
  28.  
  29. :nofile
  30.     "$0d$0a"
  31.     "No file"
  32.     "$0d$0a"
  33.     goto :command
  34.  
  35. :dirfile
  36.     @n = 0
  37.     if ( substr(@a, 4, 40) = "" ) goto :dirfile1
  38.     @g = substr(@a, 5, 40)
  39.     if (substr(@g, strlen(@g), 1) = "\") @g = concat(@g, "*.*")
  40.  
  41. :dirfile2
  42.     @f = FINDFIRST("@g")
  43.     if (@f = -1) goto :nofile
  44.     goto :donext
  45.  
  46. :dirfile1
  47.     @f = FINDFIRST("*.*")
  48.     if (@f = -1) goto :nofile
  49. :donext
  50.     "@f"
  51.     "$0d$0a"
  52.     @n = expr(@n + 1)
  53.     @f = findnext
  54.     if (@f = -1) goto :command
  55.     if (@n >20) goto :plist
  56.     goto :donext
  57.  
  58. :plist
  59.     @n = 0
  60.     "Pause, press enter to continue"
  61.     @a=getline
  62.     "$0d$0a"
  63.     goto :donext    
  64.  
  65.  
  66. :filetrans
  67.      "$0d$0a"
  68.      "Do you want to use Xmodem_Check[S]um, Xmodem_[C]RC, Xmodem_[1],"
  69.      "$0d$0a[X]modem_1K_G, Ymodem_[G], [Y]modem, [K]ermit, [Z]modem or [Q]uit?"
  70.      "$0d$0a(S/C/1/X/G/Y/K/Z/Q):$0d$0a"
  71.      @a = getline
  72.      @a = toupper(@a)
  73.      @p = " "
  74.      @b = 0
  75.      if ( substr(@a, 1, 1) = "S" ) @p = "Xmodem"
  76.      if ( substr(@a, 1, 1) = "S" ) @b = 1
  77.      if ( substr(@a, 1, 1) = "C" ) @p = "Xmodem"
  78.      if ( substr(@a, 1, 1) = "C" ) @b = 2
  79.      if ( substr(@a, 1, 1) = "1" ) @p = "Xmodem"
  80.      if ( substr(@a, 1, 1) = "1" ) @b = 3
  81.      if ( substr(@a, 1, 1) = "X" ) @p = "Xmodem"
  82.      if ( substr(@a, 1, 1) = "X" ) @b = 4
  83.      if ( substr(@a, 1, 1) = "G" ) @p = "Ymodem"
  84.      if ( substr(@a, 1, 1) = "G" ) @b = 1
  85.      if ( substr(@a, 1, 1) = "Y" ) @p = "Ymodem"
  86.      if ( substr(@a, 1, 1) = "Y" ) @b = 2
  87.      if ( substr(@a, 1, 1) = "K" ) @p = "Kermit"
  88.      if ( substr(@a, 1, 1) = "Z" ) @p = "Zmodem"
  89.      if ( substr(@a, 1, 1) = "Q" ) goto :command
  90.      if ( substr(@p, 1, 1) = " " ) goto :filetrans
  91.      "$0d$0aWant [D]ownload, [U]pload file or [Q]uit? (D/U/Q):$0d$0a"
  92.      @a = getline
  93.      @a=toupper(@a)
  94.      if ( substr(@a, 1, 1) = "D" ) goto :fname1
  95.      if ( substr(@a, 1, 1) = "U" ) goto :fname2
  96.      if ( substr(@a, 1, 1) = "Q" ) goto :command
  97.      goto :filetrans
  98.  
  99. :fname1
  100.      "$0d$0a"
  101.      "Enter ""STOP"" to stop received file."
  102. :fname1_2
  103.      "$0d$0a"
  104.      "What file name do you want to receive from the host? "
  105. {     ":>"   }
  106.      "$0d$0a"    
  107.      @f = getline
  108.      @f = toupper(@f)
  109.      if ( @f = "STOP") goto :command
  110.  
  111. :dosend
  112.      "$0d$0a"
  113.      "Would you like to logout after the file transfer?(Y/N)"
  114.      "$0d$0a"
  115.      @l = getline
  116.  
  117.      "$0d$0aGet ready to receive @p file...$0d$0a"
  118.      if ( @p = "Xmodem") goto :dosend_modem
  119.      if ( @p = "Ymodem") goto :dosend_modem
  120.      if ( @p = "Zmodem") goto :dosend_modem
  121.      if ( @p = "Kermit") goto :dosend_kermit
  122.      goto :dosend_finished
  123. :dosend_modem
  124.      Sendfile("@f", "@p", @b);
  125.      goto :dosend_finished
  126. :dosend_kermit
  127.      Kersend(@f)
  128.      goto :dosend_finished
  129. :dosend_finished
  130.      twait(1,"sec");
  131.      @l = toupper(@l)
  132.      if ( substr(@l, 1, 1) = "Y" )  goto :leave
  133.      goto :filetrans
  134.  
  135. :fname2
  136.      "$0d$0a"
  137.      if (@p = "Xmodem") goto :fname2_modem
  138.      if (@p = "Ymodem") goto :fname2_modem
  139.      if (@p = "Zmodem") goto :fname2_modem
  140.      if (@p = "Kermit") goto :fname2_kermit
  141.      goto :dosend_finished
  142. :fname2_modem
  143.      "Enter name of file to send to host: "
  144.      "$0d$0a"
  145.      @f = getline
  146.      "$0d$0a"
  147.      "Would you like to logout after the file transfer?(Y/N)"
  148.      "$0d$0a"
  149.      @l = getline
  150.  
  151.      "$0d$0aGet ready to send @p file...$0d$0a"
  152.      Recvfile("@f", "@p", @b);
  153.      twait(1,"sec");
  154.      @l = toupper(@l)
  155.      if ( substr(@l, 1, 1) = "Y" )  goto :leave
  156.      goto :filetrans
  157. :fname2_kermit
  158.      "$0d$0a"
  159.      "Would you like to logout after the file transfer?(Y/N)"
  160.      "$0d$0a"
  161.      @l = getline
  162.      "$0d$0aGet ready to send @p file...$0d$0a"
  163.      Kerrecv
  164.      twait(1,"sec");
  165.      @l = toupper(@l)
  166.      if ( substr(@l, 1, 1) = "Y" )  goto :leave
  167. :fname2_finished
  168.      goto :filetrans
  169.  
  170. :badcommand
  171.     "$0d$0a@a Command Not Allowed"
  172.     goto :command
  173.  
  174. :leave
  175.     typecr("Hang up the phone...");
  176.     hangup
  177.     typecr("Restart...");
  178.     goto :abort
  179.  
  180. :abort
  181.     exit
  182.